<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"  prefix="fmt"%>
<%
	String path = request.getContextPath();
	String webContent = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	request.setAttribute("webContent", webContent);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
        <meta name="author" content="order by dede58.com/" />
<title>${sessionScope.article.title }</title>
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="keywords" content="fly,layui,前端社区">
<meta name="description"
	content="">
<link rel="stylesheet" href="${webContent }foreground/res/layui/css/layui.css">
<link rel="stylesheet" href="${webContent }foreground/res/css/global.css">
<script src="${webContent }foreground/res/layui/layui.js"></script>
<script src="${webContent }foreground/js/jquery.js"></script>
<style type="text/css" rel="stylesheet">
form {
	margin: 0;
}

.editor {
	margin-top: 5px;
	margin-bottom: 5px;
}
</style>

</head>
<body>
	<iframe  src="${webContent }foreground/head.jsp" scrolling="no" width="100%" height="65px" ></iframe>
	<div class="main layui-clear">
		<div class="wrap">
			<div class="content detail">
				<div class="fly-panel detail-box">
					<div class="detail-about"  align="center">
						<h1>${sessionScope.article.title }</h1>
						<div align="center">
							 ${sessionScope.article.user.username }
						</div>
					</div>
					
					<div class="detail-body photos" style="margin-bottom: 20px;">
						<p>${sessionScope.article.content }</p>
					</div>
				</div>
				<!-- -----------comment----------------- -->
				<hr></hr>
				<div align="center"><h1>评论</h1></div>
				
				<div class="fly-panel detail-box" style="padding-top: 0;">
					<a name="comment"></a>
					<ul class="jieda photos" id="jieda">
						<c:forEach items="${sessionScope.comments }" var="commentOne">
							<li data-id="13"><a name="item-121212121212"></a>
								<div class="detail-body jieda-body">
									<p>${commentOne.user.username }</p>
								</div>
								<div class="jieda-reply">
									<p>${commentOne.content }</p>
								</div>
							</li>
						</c:forEach>
					</ul>
					<div>${sessionScope.addcommentmsg }</div>
					<div class="layui-form layui-form-pane">
						<form action="${webContent}addCommentByArticle/${sessionScope.article.aid}">
					        <div class="layui-form-item">
					          <label for="L_title" class="layui-form-label">评论者</label>
					          <div class="layui-input-block">
					            <input type="text" id="L_title" name="author" required lay-verify="required" autocomplete="off" class="layui-input">
					          </div>
					        </div>
							<div class="layui-form-item layui-form-text">
								<div class="layui-input-block">
										<textarea id="L_content" name="content" required
										lay-verify="required" placeholder="评论"
										class="layui-textarea fly-editor" style="height: 150px;"></textarea>
								</div>
							</div>
							<div class="layui-form-item">
								<button class="layui-btn" lay-filter="*" lay-submit>提交评论</button>
							</div>
						</form>
					</div>
				</div>
<!-- ------------------------------------------------------- -->
			</div>
		</div>
	</div>	
 <script type="text/javascript" charset="utf-8" src="res/js/kindeditor.js"></script>
  <script type="text/javascript">
    KE.show({
        id : 'L_content',
		resizeMode : 1,
        items : [
        'fontname', 'fontsize', 'textcolor', 'bgcolor', 'bold', 'italic', 'underline',
        'removeformat', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
        'insertunorderedlist', 'emoticons', 'image', 'link']
    });
  </script>
</body>
</html>